<?php
declare (strict_types = 1);

namespace app\mall\enum;

class StatusEnum extends Base
{

    public const VALID = 1; //有效
    public const INVALID = 2; //无效
    public const AUDIT = 3; //待审核
    public const TEMP = 4; //草稿箱

    public static function toZhArray(): array
    {
        return [
            self::VALID => '上架',
            self::INVALID => '下架',
            self::AUDIT => '待审核',
            self::TEMP => '草稿箱',
        ];
    }

    public function valid()
    {
        return $this->getValue() === self::VALID;
    }

}